package cn.sirun.com.fca.personal.center.loader;


import com.tencent.cloud.iov.kernel.model.BaseResponse;

import cn.sirun.com.fca.account.model.base.SubmitPhoneRequest;
import cn.sirun.com.fca.account.model.base.SubmitPhoneResponse;
import cn.sirun.com.fca.account.model.register.RegisterSubmitResponse;
import cn.sirun.com.fca.account.model.register.SubmitEmailRequest;
import cn.sirun.com.fca.personal.center.model.request.ChangeAccountResendRequest;
import cn.sirun.com.fca.personal.center.model.request.IdentityNumberRequest;
import cn.sirun.com.fca.personal.center.model.request.SubmitPhonePinRequest;
import cn.sirun.com.fca.personal.center.model.response.SubmitCodeResponse;
import cn.sirun.com.fca.personal.center.repo.ProfileRepository;
import io.reactivex.Observable;
import io.reactivex.schedulers.Schedulers;

public class ChangeRegisterAccontLoader extends PersonalCenterFlowLoader {

    public Observable<BaseResponse<Void>> submitIdentityNumber(IdentityNumberRequest request) {
        return ProfileRepository.getInstance().submitIdentityNumber(request)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<SubmitPhoneResponse>> changeAccountPhone(SubmitPhoneRequest request) {
        return ProfileRepository.getInstance().changeAccountPhone(request)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<SubmitPhoneResponse>> changeAccountEmail(SubmitEmailRequest request){
        return ProfileRepository.getInstance().changeAccountEmail(request)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<SubmitPhoneResponse>> changeAccountResend(ChangeAccountResendRequest request) {
        return ProfileRepository.getInstance().changeAccountResend(request)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<RegisterSubmitResponse>> changeAccountSubmitCaptcha(String code) {
        return ProfileRepository.getInstance().changeAccountSubmitCaptcha(code)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<SubmitPhoneResponse>> bindAccountResend() {
        return ProfileRepository.getInstance().bindAccountResend()
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<RegisterSubmitResponse>> submitBindAccountCaptcha(String code) {
        return ProfileRepository.getInstance().submitBindAccountCaptcha(code)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<SubmitPhoneResponse>> submitPhonePinCaptcha(SubmitPhoneRequest request) {
        return ProfileRepository.getInstance().submitPhonePinCaptcha(request)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<SubmitCodeResponse>> submitVerifyCaptcha(String code) {
        return ProfileRepository.getInstance().submitVerifyCaptcha(code)
                .subscribeOn(Schedulers.io());
    }

}
